/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'
import GlobalSetting from '@/views/system/global-setting'
const settingsRouter = {
  path: '/system',
  component: Layout,
  redirect: 'noredirect',
  name: 'System',
  meta: {
    title: '系统设置',
    icon: 'system',
    iconClass: 'budget_system_bettings'
  },
  children: [
    {
      path: '/global-setting',
      component: GlobalSetting,
      name: 'GlobalSetting',
      redirect: 'noredirect',
      meta: { title: '全局设置', icon: 'global_parameter', noCache: true },
      children: [
        {
          path: 'calendar',
          component: () => import('@/views/system/global-setting/calendar/index'),
          name: 'Calendar',
          meta: { title: '会计日历', noCache: true }
        },
        {
          path: 'global-param',
          component: () => import('@/views/system/global-setting/global-param/index'),
          name: 'GlobalParam',
          meta: { title: '全局参数设置' }
        }
      ]
    },
    {
      path: '/bill-setting',
      name: 'BillSetting',
      component: () => import('@/views/system/bill-setting'),
      redirect: 'noredirect',
      meta: { title: '单据设置', icon: 'document_template', noCache: true },
      children: [
        {
          path: 'extended-field-setting',
          name: 'ExtendedFieldSetting',
          component: () => import('@/views/system/bill-setting/extended-field-setting/index'),
          meta: {
            title: '扩展字段设置'
          }
        },
        {
          path: 'bill-template',
          name: 'BillTemplate',
          component: () => import('@/views/system/bill-setting/bill-template'),
          meta: {
            title: '单据模板设置'
          }
        },
        {
          path: 'bill-number-rules',
          name: 'BillNumberRules',
          component: () => import('@/views/system/bill-setting/bill-number-rules/index'),
          meta: {
            title: '单据号规则设置'
          }
        }
      ]
    },
    {
      path: '/print-setting',
      name: 'PrintSetting',
      component: () => import('@/views/system/print-setting'),
      meta: { title: '打印设置', icon: 'printing_setup', noCache: true },
      children: [
        {
          path: 'print-state',
          name: 'PrintState',
          component: () => import('@/views/system/print-setting/print-state'),
          meta: {
            title: '单据状态设置'
          }
        },
        {
          path: 'print-permission',
          name: 'PrintPermission',
          component: () => import('@/views/system/print-setting/print-permission'),
          meta: {
            title: '打印权限设置'
          }
        },
        {
          path: 'print-template',
          name: 'PrintTemplate',
          component: () => import('@/views/system/print-setting/print-template'),
          meta: {
            title: '打印模板设置'
          }
        }
      ]
    },
    {
      path: 'approval-flow',
      component: () => import('@/views/system/approval-flow/index'),
      name: 'ApprovalFlow',
      meta: {
        title: '审批流',
        icon: 'approval_flow'
      },
      alwaysShow: true,
      children: [
        {
          path: 'approval-relation',
          component: () => import('@/views/system/approval-flow/approval-relation'),
          name: 'ApprovalRelation',
          meta: { title: '审批流程配置', noCache: true }
        },
        {
          path: 'approval-type',
          component: () => import('@/views/system/approval-flow/approval-type'),
          name: 'ApprovalType',
          meta: { title: '流程列表', noCache: true }
        }

      ]
    }
  ]
}

export default settingsRouter
